Imports FluentValidation.Attributes
Imports System.ComponentModel.DataAnnotations

<Validator(GetType(AvisoValidator))>
<MetadataType(GetType(AvisoMetadata))>
Public Class Aviso

    Property Fecha() As Date
        Get
            Return FechaHora.Date
        End Get
        Set(value As Date)
            FechaHora = value.Add(Hora)
        End Set
    End Property

    Property Hora() As TimeSpan
    Get
        Return FechaHora.TimeOfDay
    End Get
    Set(value As TimeSpan)
        FechaHora = Fecha.Add(value)
    End Set
    End Property

    ReadOnly Property Completo As String
        Get
            Return String.Format("Aviso {0} ({1:dd/MM/yyyy HH:mm}, {2})", Id, FechaHora, If(Paciente Is Nothing, "", Paciente.NombreCompletoDerecho))
        End Get
    End Property

End Class
